from apps.wthg_admin.serializers.admin import AdminUserModelSerializer
from rest_framework.viewsets import ModelViewSet
from apps.users.models import User
from apps.wthg_admin.utils import UtilsPageNumberPagination
from rest_framework.generics import ListAPIView
from django.contrib.auth.models import Group
from apps.wthg_admin.serializers.admin import GroupModelSerializer
from rest_framework.permissions import DjangoModelPermissions, IsAdminUser
from rest_framework_simplejwt.authentication import JWTAuthentication

class AdminUserModelViewSet(ModelViewSet):
    """管理员管理"""
    queryset = User.objects.filter(is_staff=True)
    serializer_class = AdminUserModelSerializer
    pagination_class = UtilsPageNumberPagination
    permission_classes = [DjangoModelPermissions,]



class GroupListAPIView(ListAPIView):
    """权限组查询"""
    queryset = Group.objects.all()
    serializer_class = GroupModelSerializer



